import { mapGetters } from 'vuex';

export default {
  onShow() {
    uni.setTabBarBadge({
      index: 2,
      text: this.goodsTotal + ''
    })
  },
  computed: {
    ...mapGetters(['goodsTotal'])
  },
  watch: {
    goodsTotal(newVal) {
      uni.setTabBarBadge({
        index: 2,
        text: newVal + ''
      })
    }
  }
}
